﻿@model IEnumerable<HQPad.Controllers.UserModel>

@{
    ViewBag.Title = "Users";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

@section PageScripts {
}

<h1>Users</h1>

<section class="content">

    <div class="block">
        <table>
            <thead>
                <tr>
                    <th>User</th>
                    <th>Is Admin</th>
                    <th>Status</th>
                    <th></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@Html.ActionLink(item.User.UserName, "Edit", new { userName = item.User.UserName })</td>
                    <td>@if (item.IsAdmin) { <span>tick</span> }</td>
                    <td>@Html.Raw(item.User.IsApproved ? "Enabled" : "Disabled")
                        @if (item.User.IsLockedOut) { <br /><span>Locked out</span> }</td>
                    <td>@Html.ActionLink("Characters", "Characters", new { userName = item.User.UserName })</td>
                    <td>@Html.ActionLink("Change password", "ChangePassword", new { userName = item.User.UserName })</td>
                </tr>
            }
            </tbody>
        </table>
    </div>

</section>